<template>
  <zizujian @getData="getData"></zizujian>
  <h3 v-if="sonData">接收到子组件的值：{{ sonData }}</h3>
  <!-- {{ zuData }} -->
  {{ sonDatas }}
</template>
<script setup>
import zizujian from "./zi.vue";
import { ref, defineExpose, provide, inject } from "vue";

const sonData = ref("");

function getData(data) {
  console.log(data, 7);
  sonData.value = data;
}
defineExpose({
  getData,
});
provide("zuData", "11");
// const sonDatas = inject("sonDatas");
</script>
